#include<cstdio>//s=l/2+n-1;
#include<cmath>
#include<cstdlib>
int a,b,c,d,e,f;
int area(){
    return abs((a*d+c*f+b*e-a*f-b*c-d*e)/2);
}
int gcd(int x,int y)
{
    if(y==0)return x;
    else
        return gcd(y,x%y);
}
int main ()
{
    int n,m,p;
//    scanf("%d%d%d",&n,&m,&p);
    scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);

    int s=area();
    int l1=gcd(abs(a-c),abs(b-d));
    int l2=gcd(abs(a-e),abs(b-f));
    int l3=gcd(abs(c-e),abs(d-f));
    printf("%d\n",s-(l1+l2+l3)/2+1);
    return 0;
}

